#pragma once

#include <Platform/XPlatform.h>
#include <XBoostApi.h>
#include <boost/thread.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <boost/atomic.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/property_tree/ptree.hpp>  
#include <boost/property_tree/json_parser.hpp>  
#include <boost/property_tree/xml_parser.hpp>  

namespace XTrade {

	class SourcePlatform 
		: public XPlatform
		, public XBoost::EvtIdler
		, public XBoost::EvtFilter
	{
	public:
		SourcePlatform();
		~SourcePlatform();

		bool start(boost::property_tree::ptree &cfg);
		void stop();

		void on_init();
		void on_term();

		void run();

		virtual bool pre_translate_event(XBoost::Event& evt);
		virtual void on_idle(size_t tick);

	private:
		boost::asio::io_service io_service_;
		XBoost::EvtDispatcher evtdispatcher_;
	};
}
